package com.fulu.designmode.structural.proxy_pattern;

/**
 * 步骤2： 创建接口的实现类，作为代理的目标类
 */
public class RealImage implements Image {
    private String filePath;

    public RealImage(String filePath){
        this.filePath = filePath;
        loadFromDisk(filePath);
    }

    private void loadFromDisk(String filePath) {
        System.out.println("loading file : " + filePath);
    }

    @Override
    public void display() {
        System.out.println("displaying image:" + filePath);
    }
}
